package com.video.controller;

import com.common.domain.po.Video;
import com.common.result.Result;
import com.video.mapper.VideoMapper;
import com.video.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 路亚
 * @version 0.1
 * @className VideoController
 * @description
 * @date 2024/12/13 20:22
 * @since jdk11
 */
@RestController
@RequestMapping("/video")
@RequiredArgsConstructor
@Slf4j
@Api(tags = "视频管理")
public class VideoController {

    private final VideoService videoService;

    private final VideoMapper videoMapper;

    @GetMapping("/listByIds")
    @ApiOperation("根据id批量查询短剧")
    public Result listByIds(@RequestParam List<Long> ids) {
        return new Result(200, "OK", videoService.listByIds(ids));
    }

    @GetMapping("/queryByIds")
    @ApiOperation("根据id批量查询短剧")
    public List<Video> queryByIds(@RequestParam List<Long> ids) {
        return videoService.listByIds(ids);
    }

    @GetMapping("/queryIds")
    public List<Video> queryIds() {
        return videoService.list();
    }
}
